![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Oracle Performance Tuning and Optimization
Understanding How Rollback Segments WorkAs a transaction is being processed, information relating to changes made to the data files by that transaction is constantly being written to the rollback segments. It is important that this information be saved because a rollback would require that all data be restored to its original condition. The information written by the transaction to the rollback segments is called rollback entries. Depending on the length of the transaction and the amount of changes to data, there may be more than one rollback entry for each transaction. These entries are linked together so that they can easily be used in the event of a rollback. The information stored in the rollback segments includes block information about what blocks have been modified and the data as it was before the change occurred. Remember that the redo log also records information about changes in the database. The redo log along with the rollback segments can restore your data up to the point of failure. Rollback segments are concurrently used by one or more transactions. You can tune the rollback segments to provide for optimal efficiency and space usage. More transactions sharing rollback segments cause more contention and use space more efficiently. Fewer transactions per rollback segment cause less contention and waste more space. Oracle maintains what is called a transaction table for each rollback segment. The transaction table stores information about what transactions use that rollback segment and the rollback entries for each change done by these transactions. Each time a new transaction begins, it is assigned to a rollback segment. This can happen in one of two ways:
At the end of each transaction, when the COMMIT has occurred, the rollback information is released from the rollback segmentbut is not deleted, in order to provide read-consistent views for other queries that started before the transaction was committed. To retain this information as long as possible, the rollback segments are written as a circular buffer as described next. You can think of rollback segments as a sort of circular buffer. A rollback segment must have at least two extents (usually more). When a transaction fills up one extent, it starts using the next extent in sequence. When it gets to the last extent, the transaction continues with extent 1 again, if it is available (see Figure 9.3).
If the transaction uses the last extent in the segment, it looks to see whether the first extent is available. If not, another extent is created (see Figures 9.4 and 9.5).
The number of extents used for the rollback segments is determined in the definition of the rollback segments when you create them. Rollback segments are created with the following command: CREATE PUBLIC ROLLBACK SEGMENT rsname TABLESPACE tsname STORAGE ( INITIAL 100K NEXT 100K OPTIMAL 1500K MINEXTENTS 15 MAXEXTENTS 100); In this example, the following values are specified by the user:
Initially, there are MINEXTENTS number of extents in the rollback segment. As extents fill up, they are used in a circular fashion, returning to the first extent when all others are filled. If a rollback segment has used all the space in all the extents and MAXEXTENTS has not been reached, another extent is created. If the size of the rollback segment is larger than OPTIMAL and there are unused extents, the unused extents are dropped from the rollback segment. Both the creation and destruction of rollback segment extents cause overhead in the system. In addition to the overhead created by the addition of extents to a rollback segment, the transaction needing to write into that rollback segment must wait for the extent to be created before it can continue. The following sections explain how to tune your use of rollback segments.
|
![]() |
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |